#ifndef HOMEPAGE_H
#define HOMEPAGE_H

#include <QMainWindow>
#include <QPainter>
#include <QTimer>

#include <QTcpServer>//监听套接字
#include <QTcpSocket>//通信套接字
#include<QMediaPlayer>

enum Dev_Type{
    STM32,
    CLIENT,
    SERVER,
    Dev_Type_MAX,
};

typedef struct
{
    volatile bool devsta;
    volatile int ledsta;
    char wendu[24];
    char shidu[24];
}STM32_Info;


namespace Ui {
class homePage;
}

class homePage : public QMainWindow
{
    Q_OBJECT

public:
    explicit homePage(QWidget *parent = nullptr);
    ~homePage();
    void paintEvent(QPaintEvent *);
    QPixmap resizPic(QString path, int position);
    QString  getTime();

private slots:
    void on_lightbt_clicked();

    void on_beep_bt_clicked();

    void on_imag_bt_clicked();

private:
    Ui::homePage *ui;
    QTcpSocket *mysocket;
    STM32_Info dev_t;
    QMediaPlayer *player;

};

#endif // HOMEPAGE_H
